﻿using System;
using System.Collections.Generic;
using System.Text;
using Barbar.MapReport.Common.Drawing.Commands;
using Barbar.MapReport.HtmlRender.Json;

namespace Barbar.MapReport.HtmlRender.Operations {
  internal class AddLinesOperation : RenderBaseOperation {
    private AddLinesCommand m_Command;

    public AddLinesOperation(AddLinesCommand command) {
      m_Command = command;
    }

    #region RenderBaseOperation Members

    protected override void RenderInternal(RenderingContext context) {
      foreach (GeoLine geoLine in m_Command.Lines) {
        context.Write(JavaScriptFunction.AddLine, new GeoLineFactory(geoLine).ToJsonObject());
      }
    }

    #endregion
  }
}
